<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=ab, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- ab同域 8000 -->
    <!-- c      4000 -->
    <!-- a获取c的数据 -->
    <!-- a先引用c  c把值放到window.name,把a引用的地址改到b -->
    <iframe src="http://localhost:4000/c.html"
    frameborder="0" onload="load()" id="iframe"></iframe>
    <script>
        let first = true
        function load() {
            if(first){
                let iframe = document.getElementById('iframe');
                iframe.src = 'http://localhost:8000/b.html';
                first = false;
            }else{
                console.log(iframe.contentWindow.name)
            }
        }
    </script>
</body>
</html>